<!DOCTYPE HTML>
<html>
<head>
    <title>新零售链后台管理系统</title>
    <link rel="stylesheet" href="/stylesheets/style.css">
    <script src="/scripts/jquery.min.js"></script>
    <link rel="stylesheet" href="/scripts/miniui/themes/icons.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/default/miniui.css">
    <link rel="stylesheet" href="/scripts/miniui/themes/bootstrap/skin.css">
    <script src="/scripts/miniui/miniui.js"></script>
</head>
<body style="width: 100%;height: 100%;padding: 0;margin: 0">
<div id="layout1" class="mini-layout" style="width:100%;height:100%;">
    <div class="app-header" region="north" height="70" showSplit="false" showHeader="false">
        <h1 style ="margin:0;padding:15px;cursor:default;font-family:微软雅黑,黑体,宋体;">
            新零售链后台管理系统
        </h1>
        <div style="position:absolute;top:18px;right:10px;">
            <a class="mini-button mini-button-iconTop" iconCls="icon-close" onclick="onClick"  plain="true" >退出登录</a>
        </div>
    </div>
    <div title="center" region="center" bodyStyle="overflow:hidden;">
        <!--Splitter-->
        <div class="mini-splitter" style="width:100%;height:100%;" borderStyle="border:0;">
            <div size="180" maxSize="250" minSize="100" showCollapseButton="true">
                <div id="leftTree" class="mini-outlooktree" url="/json/editorMain.json" onnodeselect="onNodeSelect"
                     textField="text" idField="id" parentField="pid"
                >
                </div>
            </div>
            <div showCollapseButton="true">
                <div id="mainTabs" class="mini-tabs bg-toolbar" activeIndex="0" style="width:100%;height:99%;"
                     bodyStyle="border:0;background:white;"
                >
                    <div title="首页">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    function showTab(node) {
        var tabs = mini.get("mainTabs");
        var id = "tab$" + node.id;
        var tab = tabs.getTab(id);
        if (!tab) {
            tab = {};
            tab.name = id;
            tab.title = node.text;
            tab.showCloseButton = true;
            tab.url = node.url;
            tabs.addTab(tab);
        }
        tabs.activeTab(tab);
//        console.log(tabs)
    }

    function onNodeSelect(e) {
        var node = e.node;
        node.url = '/editor/'+node.id;
//        console.log(node);
        var isLeaf = e.isLeaf;
        if (isLeaf) {
            showTab(node);
        }
    }
    function onClick(e) {
        window.location='/logout'
    }

</script>
</html>